package cn.gson.springboot.model.pjos;

import javax.persistence.*;
import java.math.BigInteger;
import java.sql.Timestamp;
import java.util.Objects;

/**
 * 出差表
 */
@Table(name = "evection", schema = "springboot", catalog = "")
@Entity
public class Evection {
    private int evetId;             //出差id
    private Timestamp evetDate;     //开始时间
    private Timestamp evetData;     //结束时间
    private Integer evetEmpid;      //审批人
    private String evetDepart;      //出发地
    private String evetGoal;        //目的地
    private String evetSubject;     //主题
    private String evetTraffic;     //交通工具
    private String evetRemark;      //备注
    private String evetState;       //状态
    private Double evetLoan;        //借款
    private String evetStatus;      //审批状态
    private Integer evetDelete;     //逻辑删除
    private Customer customerByCustomId;
    private Emp empByEmployeesId;   //申请人

    @Id
    @Column(name = "evet_id")
    public int getEvetId() {
        return evetId;
    }

    public void setEvetId(int evetId) {
        this.evetId = evetId;
    }

    @Basic
    @Column(name = "evet_date")
    public Timestamp getEvetDate() {
        return evetDate;
    }

    public void setEvetDate(Timestamp evetDate) {
        this.evetDate = evetDate;
    }

    @Basic
    @Column(name = "evet_data")
    public Timestamp getEvetData() {
        return evetData;
    }

    public void setEvetData(Timestamp evetData) {
        this.evetData = evetData;
    }

    @Basic
    @Column(name = "evet_empid")
    public Integer getEvetEmpid() {
        return evetEmpid;
    }

    public void setEvetEmpid(Integer evetEmpid) {
        this.evetEmpid = evetEmpid;
    }

    @Basic
    @Column(name = "evet_depart")
    public String getEvetDepart() {
        return evetDepart;
    }

    public void setEvetDepart(String evetDepart) {
        this.evetDepart = evetDepart;
    }

    @Basic
    @Column(name = "evet_goal")
    public String getEvetGoal() {
        return evetGoal;
    }

    public void setEvetGoal(String evetGoal) {
        this.evetGoal = evetGoal;
    }

    @Basic
    @Column(name = "evet_subject")
    public String getEvetSubject() {
        return evetSubject;
    }

    public void setEvetSubject(String evetSubject) {
        this.evetSubject = evetSubject;
    }

    @Basic
    @Column(name = "evet_traffic")
    public String getEvetTraffic() {
        return evetTraffic;
    }

    public void setEvetTraffic(String evetTraffic) {
        this.evetTraffic = evetTraffic;
    }

    @Basic
    @Column(name = "evet_remark")
    public String getEvetRemark() {
        return evetRemark;
    }

    public void setEvetRemark(String evetRemark) {
        this.evetRemark = evetRemark;
    }

    @Basic
    @Column(name = "evet_state")
    public String getEvetState() {
        return evetState;
    }

    public void setEvetState(String evetState) {
        this.evetState = evetState;
    }

    @Basic
    @Column(name = "evet_loan")
    public Double getEvetLoan() {
        return evetLoan;
    }

    public void setEvetLoan(Double evetLoan) {
        this.evetLoan = evetLoan;
    }

    @Basic
    @Column(name = "evet_status")
    public String getEvetStatus() {
        return evetStatus;
    }

    public void setEvetStatus(String evetStatus) {
        this.evetStatus = evetStatus;
    }

    @Basic
    @Column(name = "evet_delete")
    public Integer getEvetDelete() {
        return evetDelete;
    }

    public void setEvetDelete(Integer evetDelete) {
        this.evetDelete = evetDelete;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Evection evection = (Evection) o;
        return evetId == evection.evetId &&
                Objects.equals(evetDate, evection.evetDate) &&
                Objects.equals(evetData, evection.evetData) &&
                Objects.equals(evetDepart, evection.evetDepart) &&
                Objects.equals(evetGoal, evection.evetGoal) &&
                Objects.equals(evetSubject, evection.evetSubject) &&
                Objects.equals(evetTraffic, evection.evetTraffic) &&
                Objects.equals(evetRemark, evection.evetRemark) &&
                Objects.equals(evetState, evection.evetState)&&
                Objects.equals(evetDelete, evection.evetDelete);
    }

    @Override
    public int hashCode() {
        return Objects.hash(evetId, evetDate, evetData, evetDepart, evetGoal, evetSubject, evetTraffic, evetRemark, evetState, evetDelete);
    }

    @ManyToOne
    @JoinColumn(name = "custom_id", referencedColumnName = "custom_id")
    public Customer getCustomerByCustomId() {
        return customerByCustomId;
    }

    public void setCustomerByCustomId(Customer customerByCustomId) {
        this.customerByCustomId = customerByCustomId;
    }

    @ManyToOne
    @JoinColumn(name = "employees_id", referencedColumnName = "employees_id")
    public Emp getEmpByEmployeesId() {
        return empByEmployeesId;
    }

    public void setEmpByEmployeesId(Emp empByEmployeesId) {
        this.empByEmployeesId = empByEmployeesId;
    }

}
